<%@page import="beans.*"%>
<%@page import="controladores.*"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@include file='master/header.jsp'%>

	<form name="abrirM" method="get" onsubmit="return validarForm_abrir_mesa()"> <!-- >-->
		<h1>Comandas </h1><br>
		
				
				<% 
// 				try{
					String tipo1 = request.getParameter("a");
					
					if (true){//(tipo1.equals("Cafeteria")){
						%>
						<b>Cafeteria</b><br><br>
						<table class="listado">	
						<tr>
							<th>NroComanda</th>
							<th>Mozo</th>
							<th>Mesa</th>
							<th>Sector</th>
							<th></th>
						</tr>	
						<%
						Controlador c = new Controlador();
						List<Object[]> comandas = c.comandasList(tipo1);
						
						for (Object[] com : comandas){
							out.print("<tr>");
							out.print("<td>"+com[0]+"</td><td>"+com[1]+"</td><td>"+com[2]+"</td><td>"+com[3]+
									"</td><td><a href='ComandaView.jsp?id="+com[0]+"'>VER</a></td>");
							

							out.print("</td>");
							
							out.print("</tr>");
						}
					}else{
						out.print(tipo1);
						//response.sendRedirect( "ppal.jsp" ) ;
					}
						
// 				}catch(Exception ex){
// 					out.print("<b>Error en el listado</b> ");
// 				}
				
				%>
				</table>
		<br>
		 <br>
		 <br><br>
	
	</form>
<%@include file='master/footer.jsp'%>